#pragma once

#include "Hazel.h"
namespace Hazel
{
class EditorLayer : public Layer
{
  public:
    EditorLayer();
    virtual ~EditorLayer() = default;
    virtual void OnAttach() override;
    virtual void OnDetach() override;
    void OnUpdate(Hazel::Timestep ts) override;
    virtual void OnImGuiRender() override;
    void OnEvent(Hazel::Event &e) override;

  private:
    OrthographicCameraController m_CameraController;

    // temp
    Ref<VertexArray> m_SquareVA;
    Ref<Shader> m_FlatColorShader;

    Ref<Texture2D> m_CheckboardTexture;
    Ref<Texture2D> m_SpriteSheet;
    Ref<SubTexture2D> m_TextureFlag, m_TextureTree;
    Ref<FrameBuffer> m_FrameBuffer;

    struct ProfileResult
    {
        const char *name;
        float time;
    };

    glm::vec2 m_ViewportSize = {0.0f, 0.0f};
    std::vector<ProfileResult> m_ProfileResults;
    glm::vec4 m_SquareColor = {0.2f, 0.3f, 0.8f, 1.0f};
    std::unordered_map<char, Ref<SubTexture2D>> m_MapElement;
};
} // namespace Hazel